/*
 * @Author: yuan-3-07 2144849287@qq.com
 * @Date: 2023-02-20 20:13:57
 * @LastEditors: yuan-3-07 2144849287@qq.com
 * @LastEditTime: 2023-02-22 09:17:44
 * @FilePath: \fitness-app\fitness03\src\utils\validator.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 工具类的函数  ----封装一些小工具

//验证相关

//1.手机号
function checkPhone(val){
    return /(^1\d{10}$)|(^[0-9]\d{7}$)/.test(val)
}


//2.密码
function checkPwd(val){
    return /^[A-Za-z0-9]{4,7}$/.test(val)
}



//暴露出去
module.exports={
    checkPhone,
    checkPwd
}